Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix splits KeyError while downloading #273

Merged
merged 1 commit into from Oct 2, 2021

Conversation

guoqiao
Copy link
Contributor

@guoqiao guoqiao commented Sep 27, 2020

Currently downloading will fail with following error:

gplaycli --verbose --progress -d com.pushbullet.android
[INFO] GPlayCli version 3.29 [Python3.8.2]
[INFO] Configuration file is /home/guoqiao/git/gplaycli/gplaycli.conf
[INFO] Device is bacon
[INFO] Using credentials to connect to API
[INFO] Using plaintext password
[INFO] 1 / 1 com.pushbullet.android
/usr/local/lib/python3.8/dist-packages/gpapi/googleplay.py:634: RuntimeWarning: Unexpected end-group tag: Not all data was converted
  response = googleplay_pb2.ResponseWrapper.FromString(response.content)
Traceback (most recent call last):
  File "/usr/local/bin/gplaycli", line 11, in <module>
    load_entry_point('gplaycli', 'console_scripts', 'gplaycli')()
  File "/home/guoqiao/git/gplaycli/gplaycli/gplaycli.py", line 659, in main
    cli.download(args.download)
  File "/home/guoqiao/git/gplaycli/gplaycli/hooks.py", line 11, in check_connection
    return function(self, *args, **kwargs)
  File "/home/guoqiao/git/gplaycli/gplaycli/gplaycli.py", line 290, in download
    splits = data_iter['splits']
KeyError: 'splits'

Use get to avoid dict KeyError while splits not exists in data_iter.

Fixes: #272

Signed-off-by: Qiao Guo guoqiao@gmail.com

Currently downloading will fail with following error:

```
gplaycli --verbose --progress -d com.pushbullet.android
[INFO] GPlayCli version 3.29 [Python3.8.2]
[INFO] Configuration file is /home/guoqiao/git/gplaycli/gplaycli.conf
[INFO] Device is bacon
[INFO] Using credentials to connect to API
[INFO] Using plaintext password
[INFO] 1 / 1 com.pushbullet.android
/usr/local/lib/python3.8/dist-packages/gpapi/googleplay.py:634: RuntimeWarning: Unexpected end-group tag: Not all data was converted
  response = googleplay_pb2.ResponseWrapper.FromString(response.content)
Traceback (most recent call last):
  File "/usr/local/bin/gplaycli", line 11, in <module>
    load_entry_point('gplaycli', 'console_scripts', 'gplaycli')()
  File "/home/guoqiao/git/gplaycli/gplaycli/gplaycli.py", line 659, in main
    cli.download(args.download)
  File "/home/guoqiao/git/gplaycli/gplaycli/hooks.py", line 11, in check_connection
    return function(self, *args, **kwargs)
  File "/home/guoqiao/git/gplaycli/gplaycli/gplaycli.py", line 290, in download
    splits = data_iter['splits']
KeyError: 'splits'
```

Use `get` to avoid dict `KeyError` while `splits` not exists in `data_iter`.

Fixes: matlink#272

Signed-off-by: Qiao Guo <guoqiao@gmail.com>
@matlink matlink merged commit 9a20fd4 into matlink:master Oct 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

googleplay.py:645: RuntimeWarning: Unexpected end-group tag: Not all data was converted
2 participants